<%@ Page Language="C#" Trace="False" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="DailyScrumEntry.aspx.cs" Inherits="DailyScrumEntry" Title="Tackle - Daily Scrum Entry" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ MasterType VirtualPath="~/MasterPage.master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentHolder" runat="Server">
    <strong>Daily Scrum Entry<br />
        <br />
    </strong><span style="font-size: 8pt">This page allows the updating of task times and
        notes.</span><br />
    <br />
    <table cellpadding="4" cellspacing="0" style="width: 98%">
        <tr>
            <td valign="top" style="border-top: silver 1px ridge; border-left: silver 1px ridge;
                border-bottom: silver 1px ridge;" bgcolor="#e3eaeb">
                <span style="font-size: x-small">Sprint:</span>&nbsp;<asp:DropDownList ID="ddSprintSelection"
                    runat="server" AutoPostBack="True" DataSourceID="dsGetSprintNames" DataTextField="SprintName"
                    DataValueField="SprintID" Font-Size="X-Small" OnDataBound="ddSprintSelection_DataBound"
                    OnSelectedIndexChanged="ddSprintSelection_SelectedIndexChanged" Font-Names="Verdana">
                </asp:DropDownList>
            </td>
            <td valign="top" style="border-top: silver 1px ridge; border-bottom: silver 1px ridge;"
                bgcolor="#e3eaeb">
                <asp:UpdatePanel runat="server" ID="UPFilterFeature">
                    <ContentTemplate>
                        <span style="font-size: x-small">Feature:</span>&nbsp;<asp:DropDownList ID="ddFilterProdFeature"
                            runat="server" AutoPostBack="True" DataSourceID="dsFilterProdFeature" DataTextField="ProdFeature"
                            DataValueField="MasterBacklogID" Font-Names="Verdana" Font-Size="X-Small" OnSelectedIndexChanged="ddFilterProdFeature_SelectedIndexChanged"
                            OnDataBound="ddFilterProdFeature_DataBound">
                            <asp:ListItem Value="-3">All</asp:ListItem>
                            <asp:ListItem Value="-2">OOF</asp:ListItem>
                            <asp:ListItem Value="-1">Discovered</asp:ListItem>
                        </asp:DropDownList></ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostbackTrigger ControlID="ddSprintSelection" EventName="SelectedIndexChanged" />
                    </Triggers>
                </asp:UpdatePanel>
            </td>
            <td bgcolor="#e3eaeb" colspan="2" style="border-right: silver 1px ridge; border-top: silver 1px ridge;
                border-bottom: silver 1px ridge; text-align: right" valign="top">
                <asp:UpdatePanel runat="server" ID="UPUserFilter">
                    <ContentTemplate>
                        <span style="font-size: x-small">Owner:&nbsp</span><asp:DropDownList ID="ddUserFilter"
                            runat="server" AutoPostBack="True" DataSourceID="dsTaskOwners" DataTextField="Owner"
                            DataValueField="PersonID" Font-Names="Verdana" Font-Size="X-Small" OnSelectedIndexChanged="ddUserFilter_SelectedIndexChanged"
                            OnDataBound="ddUserFilter_DataBound">
                        </asp:DropDownList>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostbackTrigger ControlID="ddSprintSelection" EventName="SelectedIndexChanged" />
                    </Triggers>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td bgcolor="#eeebec" colspan="2" style="border-top-width: 1px; border-left: silver 1px ridge;
                border-top-color: silver; border-bottom: silver 1px ridge; text-align: left;
                border-right-width: 1px; border-right-color: silver; width: 50%;" valign="top">
                <asp:CheckBox ID="chbHideCompleteTasks" runat="server" AutoPostBack="True" Checked="True"
                    Font-Names="Verdana" Font-Size="X-Small" OnCheckedChanged="chbHideCompleteTasks_CheckedChanged"
                    Text="Hide Completed Tasks" ToolTip="Show or hide tasks that have remaining time as 0.00" />
                |<asp:CheckBox ID="chbSortDSOrder" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                    OnCheckedChanged="chbSortDSOrder_CheckedChanged" Text="Sort Features by Rank"
                    AutoPostBack="True" Checked="False" ToolTip="Set the sort order for the feature list to either Master Rank or Alphabetical" /></td>
            <td valign="top" style="text-align: right; border-top-width: 1px; border-right: silver 1px ridge;
                border-left-width: 1px; border-left-color: silver; border-top-color: silver;
                border-bottom: silver 1px ridge; width: 50%;" bgcolor="#eeebec" align="right">
                <span style="font-size: x-small"></span>
                <asp:UpdatePanel runat="server" ID="UpdatePanel2" UpdateMode="Conditional">
                    <ContentTemplate>
                        <div align="right">
                            <span style="font-size: x-small">Enter Time for:
                                <asp:LinkButton ID="lbPrevDay" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                    ForeColor="Black" ToolTip="Previous Day" OnClick="lbPrevDay_Click"><</asp:LinkButton></span><asp:TextBox
                                        ID="txtDateofEntry" runat="server" Font-Size="X-Small" MaxLength="10" ToolTip="The date the scrum entry should be associated with"
                                        Width="60px" ReadOnly="True"></asp:TextBox><asp:LinkButton ID="lbNextDay" runat="server"
                                            Font-Names="Verdana" Font-Size="X-Small" ForeColor="Black" ToolTip="Next Day"
                                            OnClick="lbNextDay_Click">></asp:LinkButton>
                            <asp:ImageButton ID="btnShowCal" runat="server" ImageUrl="~/Images/Cal_Web.png" OnClick="btnShowCal_Click"
                                ToolTip="Click to show a calender to select a date" ImageAlign="AbsMiddle" /></div>
                                <asp:Panel ID="panelCal" runat="Server" HorizontalAlign="Center">
                            <asp:Calendar ID="calEntryDate" runat="server" BackColor="#E3EAEB" DayNameFormat="FirstTwoLetters"
                                Font-Size="X-Small" OnSelectionChanged="calEntryDate_SelectionChanged" Visible="True">
                                <WeekendDayStyle BackColor="White" />
                            </asp:Calendar>
                        <cc1:PopupControlExtender id="calPopup" runat="server" TargetControlID="btnShowCal" PopupControlID="panelCal"
                                Position="Top"></cc1:PopupControlExtender>
                            <asp:RangeValidator ID="rvDateEntry" runat="server" ControlToValidate="txtDateofEntry"
                                Font-Names="Verdana" Font-Size="X-Small" Type="Date" BackColor="#E3EAEB" BorderStyle="Solid" BorderWidth="1px" Width="165px"></asp:RangeValidator></asp:Panel>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostbackTrigger ControlID="calEntryDate" EventName="SelectionChanged" />
                        <asp:AsyncPostbackTrigger ControlID="ddSprintSelection" EventName="SelectedIndexChanged" />
                    </Triggers>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td colspan="4">
                <asp:UpdatePanel runat="server" ID="UPDataList">
                    <ContentTemplate>
                        <asp:DataList ID="dlProdFeatureList" runat="server" DataKeyField="MasterBacklogID"
                            DataSourceID="dsSprintBacklogProdFeature" Width="100%" OnPreRender="dlProdFeatureList_PreRender">
                            <ItemTemplate>
                                <table width="100%" cellpadding="0" border="0" style="border-right: silver 1px ridge;
                                    border-top: silver 1px ridge; border-left: silver 1px ridge; border-bottom: silver 1px ridge"
                                    height="1" cellspacing="0">
                                    <tr>
                                        <td colspan="2" bgcolor="silver">
                                            &nbsp;<asp:LinkButton ID="lkbBacklogItem" runat="server" CommandArgument='<%# Eval("MasterBacklogID") %>'
                                                CommandName="MBID" Font-Bold="True" Font-Names="Verdana" Font-Size="X-Small"
                                                ForeColor="Black" OnClick="lkbBacklogItem_Click" Text='<%# Eval("ProdFeature") %>'
                                                ToolTip="Click to Filter to this Backlog Item"></asp:LinkButton>
                                            <span>
                                                <asp:Label ID="lblMBID" runat="server" Font-Size="X-Small" Height="8px" Text='<%# Eval("MasterBacklogID") %>'
                                                    Visible="False" ForeColor="Black"></asp:Label><br />
                                                <span style="font-size: 1pt">
                                                    <br />
                                                </span><span style="font-size: x-small; color: #ffffff"></span></span>
                                            <asp:GridView ID="gvSprintBacklogPerMBID" runat="server" AutoGenerateColumns="False"
                                                CellPadding="4" DataKeyNames="SprintBacklogID" DataSourceID="dsSprintBacklog"
                                                Font-Names="Verdana" Font-Size="X-Small" ForeColor="#333333" GridLines="None"
                                                Width="100%" OnRowUpdating="GridViews_RowUpdating" AllowSorting="True" OnPreRender="GridView_PreRender"
                                                OnDataBound="GridView_DataBound" OnRowEditing="GridView_RowEditing" OnRowCancelingEdit="GridView_CancelEdit"
                                                OnRowUpdated="GridView_RowUpdated" OnRowDataBound="GridView_RowDataBound">
                                                <FooterStyle BackColor="Silver" Font-Bold="True" ForeColor="White" />
                                                <Columns>
                                                    <asp:BoundField DataField="SprintBacklogID" HeaderText="ID" InsertVisible="False"
                                                        ReadOnly="True" SortExpression="SprintBacklogID" Visible="False" />
                                                    <asp:TemplateField HeaderText="Task" SortExpression="Task">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBoxTask" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                                                Height="36px" MaxLength="255" Text='<%# Bind("Task") %>' TextMode="MultiLine"
                                                                ToolTip="The description of the task to be completed by the task owner" Width="95%"></asp:TextBox><asp:RequiredFieldValidator
                                                                    ID="rfvTask" runat="server" ControlToValidate="TextBoxTask" ErrorMessage="*?"
                                                                    ForeColor="LightCoral" Font-Names="Verdana" Font-Size="Small" ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator><asp:CustomValidator
                                                                        ID="cvalidTask" runat="server" ControlToValidate="TextBoxTask" ErrorMessage="* Only 255 chars allowed."
                                                                        ForeColor="LightCoral" OnServerValidate="CustValMLMaxLength_ServerValidate" ToolTip="255"></asp:CustomValidator>
                                                        </EditItemTemplate>
                                                        <ItemStyle Width="35%" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("Task") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <FooterTemplate>
                                                            <asp:Image ID="imgOOFTimeUpdate" runat="server" ImageAlign="AbsBottom" ImageUrl="~/Images/Flag_redHS.png" /><asp:Label
                                                                ID="lblOOFAddTimeInfo" runat="server" Font-Bold="True" Font-Names="Verdana" Font-Size="X-Small"
                                                                ForeColor="#C00000" Text="Please update the time estimates and notes."></asp:Label>
                                                        </FooterTemplate>
                                                    </asp:TemplateField>
                                                    <asp:BoundField DataField="TaskOwnerID" HeaderText="TaskOwnerID" SortExpression="TaskOwnerID"
                                                        Visible="False" />
                                                    <asp:TemplateField HeaderText="Owner" SortExpression="Person">
                                                        <EditItemTemplate>
                                                            <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="dsResourceName"
                                                                DataTextField="Person" DataValueField="SprintResourcesID" Font-Names="Verdana"
                                                                Font-Size="X-Small" SelectedValue='<%# Bind("TaskOwnerID") %>'>
                                                            </asp:DropDownList>
                                                        </EditItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("Person") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <ItemStyle Width="5%" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Base" SortExpression="BaseTime">
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("BaseTime", "{0:F}") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <ItemStyle Width="5%" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Actual" SortExpression="ActualTimeTotal">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox1" runat="server" Font-Size="X-Small" Text='<%# Bind("ActualTimeTotal", "{0:F}") %>'
                                                                ToolTip="Enter the amount of time completed on the task total." Width="32px"
                                                                Font-Names="Verdana" OnPreRender="SetupOnFocus_PreRender"></asp:TextBox><asp:RequiredFieldValidator
                                                                    ID="rfv1" runat="server" ControlToValidate="TextBox1" ErrorMessage="*?" ForeColor="LightCoral"
                                                                    Font-Names="Verdana" Font-Size="Small" ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator><asp:RangeValidator
                                                                        ID="rv1" runat="server" ControlToValidate="TextBox1" ErrorMessage="*#" ForeColor="LightCoral"
                                                                        Font-Names="Verdana" Font-Size="Small" MaximumValue="10000" MinimumValue="0"
                                                                        ToolTip="This field must contain a number between 0 and 10000" Type="Double"></asp:RangeValidator>
                                                        </EditItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="actualTime" runat="server" Text='<%# Bind("ActualTimeTotal", "{0:F}") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <ItemStyle Width="5%" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Remaining" SortExpression="RemainingTimeTotal">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox2" runat="server" Font-Size="X-Small" Text='<%# Bind("RemainingTimeTotal", "{0:F}") %>'
                                                                ToolTip="Enter the amount of time remaining on the task." Width="32px" Font-Names="Verdana"
                                                                OnPreRender="SetupOnFocus_PreRender"></asp:TextBox><asp:RequiredFieldValidator ID="rfv2"
                                                                    runat="server" ControlToValidate="TextBox2" ErrorMessage="*?" ForeColor="LightCoral"
                                                                    Font-Names="Verdana" Font-Size="Small" ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator><asp:RangeValidator
                                                                        ID="rv2" runat="server" ControlToValidate="TextBox2" ErrorMessage="*#" ForeColor="LightCoral"
                                                                        Font-Names="Verdana" Font-Size="Small" MaximumValue="10000" MinimumValue="0"
                                                                        ToolTip="This field must contain a number between 0 and 10000" Type="Double"></asp:RangeValidator>
                                                        </EditItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="remainingTime" runat="server" Text='<%# Bind("RemainingTimeTotal", "{0:F}") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <ItemStyle Width="5%" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Punted" SortExpression="PuntedTimeTotal">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox3" runat="server" Font-Size="X-Small" Text='<%# Bind("PuntedTimeTotal", "{0:F}") %>'
                                                                ToolTip="Enter the amount of time punted on the task." Width="32px" Font-Names="Verdana"
                                                                OnPreRender="SetupOnFocus_PreRender"></asp:TextBox><asp:RequiredFieldValidator ID="rfv3"
                                                                    runat="server" ControlToValidate="TextBox3" ErrorMessage="*?" ForeColor="LightCoral"
                                                                    Font-Names="Verdana" Font-Size="Small" ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator><asp:RangeValidator
                                                                        ID="rv3" runat="server" ControlToValidate="TextBox3" ErrorMessage="*#" ForeColor="LightCoral"
                                                                        Font-Names="Verdana" Font-Size="Small" MaximumValue="10000" MinimumValue="0"
                                                                        ToolTip="This field must contain a number between 0 and 10000" Type="Double"></asp:RangeValidator>
                                                        </EditItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label7" runat="server" Text='<%# Bind("PuntedTimeTotal", "{0:F}") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <ItemStyle Width="5%" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Unbuff" SortExpression="Unbuffered">
                                                        <EditItemTemplate>
                                                            <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("Unbuffered") %>' ToolTip="An unbuffered task is one in which the hours are time boxed." />
                                                        </EditItemTemplate>
                                                        <ItemStyle Width="5%" />
                                                        <ItemTemplate>
                                                            <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("Unbuffered") %>' Enabled="false"
                                                                ToolTip="An unbuffered task is one in which the hours are time boxed." />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Disc" SortExpression="Discovered">
                                                        <EditItemTemplate>
                                                            <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("Discovered") %>' ToolTip="A discovered task is one that was not planned or accounted for during sprint planning." />
                                                        </EditItemTemplate>
                                                        <ItemStyle Width="5%" />
                                                        <ItemTemplate>
                                                            <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("Discovered") %>' Enabled="false"
                                                                ToolTip="A discovered task is one that was not planned or accounted for during sprint planning." />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Pri" SortExpression="Priority">
                                                        <EditItemTemplate>
                                                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("Priority") %>' ToolTip="The priority of the task. This list of tasks is sorted on this column by default."></asp:Label>
                                                        </EditItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label5" runat="server" Text='<%# Bind("Priority") %>' ToolTip="The priority of the task. This list of tasks is sorted on this column by default."></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Notes" SortExpression="Notes">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox5" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                                                Height="36px" MaxLength="255" Text='<%# Bind("Notes") %>' TextMode="MultiLine"
                                                                ToolTip="Any notes associated with the task" Width="95%"></asp:TextBox><br />
                                                            <asp:CustomValidator ID="cvalidNotes" runat="server" ControlToValidate="TextBox5"
                                                                ErrorMessage="* Only 255 chars allowed." ForeColor="LightCoral" OnServerValidate="CustValMLMaxLength_ServerValidate"
                                                                ToolTip="255"></asp:CustomValidator>
                                                        </EditItemTemplate>
                                                        <ItemStyle Width="15%" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("Notes") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:CommandField ShowEditButton="True" HeaderText="Edit">
                                                        <ItemStyle Width="5%" />
                                                    </asp:CommandField>
                                                    <asp:TemplateField HeaderText="Mark As">
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="lbMBTaskComplete" runat="server" CommandArgument='<%# Eval("RemainingTimeTotal", "{0:F}") %>'
                                                                CommandName='<%# Eval("SprintBacklogID") %>' ForeColor="Black" OnClick="lbTaskComplete_Click"
                                                                OnClientClick="return confirm('Are you sure want to mark this task complete?');"
                                                                ToolTip="Sets remaining time to 0.00">Complete</asp:LinkButton>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Add Time">
                                                        <ItemStyle HorizontalAlign="Center" Width="10%" />
                                                        <HeaderStyle Wrap="False" HorizontalAlign="Center" />
                                                        <ItemTemplate>
                                                            <asp:DropDownList ID="ddQuickUpdateMBID" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                                                OnSelectedIndexChanged="ddQuickUpdate_SelectedIndexChanged" AutoPostBack="True">
                                                                <asp:ListItem Selected="True">0.00</asp:ListItem>
                                                                <asp:ListItem>0.25</asp:ListItem>
                                                                <asp:ListItem>0.50</asp:ListItem>
                                                                <asp:ListItem>1.00</asp:ListItem>
                                                                <asp:ListItem>1.50</asp:ListItem>
                                                                <asp:ListItem>2.00</asp:ListItem>
                                                                <asp:ListItem>2.50</asp:ListItem>
                                                                <asp:ListItem>3.00</asp:ListItem>
                                                                <asp:ListItem>3.50</asp:ListItem>
                                                                <asp:ListItem>4.00</asp:ListItem>
                                                                <asp:ListItem>4.50</asp:ListItem>
                                                                <asp:ListItem>5.00</asp:ListItem>
                                                                <asp:ListItem>5.50</asp:ListItem>
                                                                <asp:ListItem>6.00</asp:ListItem>
                                                                <asp:ListItem>6.50</asp:ListItem>
                                                                <asp:ListItem>7.00</asp:ListItem>
                                                                <asp:ListItem>7.50</asp:ListItem>
                                                                <asp:ListItem>8.00</asp:ListItem>
                                                            </asp:DropDownList><asp:Label ID="lblSBID" runat="server" Text='<%# Eval("SprintBacklogID") %>'
                                                                Visible="False"></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                                <RowStyle BackColor="#E3EAEB" VerticalAlign="Top" />
                                                <EditRowStyle BackColor="#7C6F57" VerticalAlign="Top" ForeColor="White" />
                                                <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                                                <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                                                <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                                                <AlternatingRowStyle BackColor="White" />
                                            </asp:GridView>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td bgcolor="silver" colspan="2" style="height: 17px; width: 765px;">
                                            &nbsp;<asp:LinkButton ID="lbNewBacklogTask" runat="server" CommandArgument='<%# Eval("MasterBacklogID") %>'
                                                CommandName="NewBacklogTask" Font-Bold="True" Font-Names="Verdana" Font-Size="X-Small"
                                                ForeColor="#1C5E55" OnClick="lbNewBacklogTask_Click">New Task</asp:LinkButton></td>
                                    </tr>
                                </table>
                                <asp:SqlDataSource ID="dsSprintBacklog" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
                                    ProviderName="<%$ ConnectionStrings:TackleConnectionStringMain.ProviderName %>"
                                    SelectCommand="SELECT tblSprintBacklog.SprintBacklogID, tblSprintBacklog.Task, tblSprintResources.Person, tblSprintBacklog.TaskOwnerID, tblSprintBacklog.BaseTime * @TimeMult AS BaseTime, tblSprintBacklog.ActualTimeTotal * @TimeMult AS ActualTimeTotal, tblSprintBacklog.RemainingTimeTotal * @TimeMult AS RemainingTimeTotal, tblSprintBacklog.PuntedTimeTotal * @TimeMult AS PuntedTimeTotal, tblSprintBacklog.Notes, IsNull(tblSprintBacklog.Unbuffered,0) as Unbuffered, tblSprintBacklog.Discovered, tblSprintBacklog.fMasterBacklogID, tblSprintBacklog.fSprintID, tblSprintBacklog.Priority FROM tblSprintBacklog INNER JOIN tblSprintResources ON tblSprintBacklog.TaskOwnerID = tblSprintResources.SprintResourcesID WHERE (tblSprintBacklog.fMasterBacklogID = @MasterBacklogID) AND (tblSprintBacklog.fSprintID = @SprintID) AND (tblSprintResources.SprintResourcesID LIKE @Person) AND (tblSprintBacklog.RemainingTimeTotal > @RemainingTimeTotalFilter - 1) OR (tblSprintBacklog.fMasterBacklogID = @MasterBacklogID) AND (tblSprintBacklog.fSprintID = @SprintID) AND (tblSprintResources.SprintResourcesID LIKE @Person) AND (tblSprintBacklog.SprintBacklogID = @ShowSBID) ORDER BY tblSprintBacklog.Priority, SprintBacklogID"
                                    DeleteCommand="DELETE FROM tblSprintBacklog WHERE (SprintBacklogID = @original_SprintBacklogID)"
                                    OnDeleting="dsSprintBacklog_Deleting" OldValuesParameterFormatString="original_{0}"
                                    UpdateCommand="UPDATE tblSprintBacklog SET Task = @Task, TaskOwnerID = @TaskOwnerID, ActualTimeTotal = @ActualTimeTotal, RemainingTimeTotal = @RemainingTimeTotal, PuntedTimeTotal = @PuntedTimeTotal,  Unbuffered = @Unbuffered, Discovered = @Discovered, Notes = @Notes WHERE (SprintBacklogID = @original_SprintBacklogID)">
                                    <SelectParameters>
                                        <asp:SessionParameter Name="TimeMult" SessionField="SBTimeMult" DefaultValue="" />
                                        <asp:ControlParameter ControlID="lblMBID" Name="MasterBacklogID" PropertyName="Text" />
                                        <asp:ControlParameter ControlID="ddSprintSelection" Name="SprintID" PropertyName="SelectedValue" />
                                        <asp:ControlParameter ControlID="ddUserFilter" Name="Person" PropertyName="SelectedValue" />
                                        <asp:ControlParameter ControlID="chbHideCompleteTasks" Name="RemainingTimeTotalFilter"
                                            PropertyName="Checked" />
                                        <asp:SessionParameter DefaultValue="0" Name="ShowSBID" SessionField="DailyScrumEntry_ShowSBID" />
                                    </SelectParameters>
                                    <DeleteParameters>
                                        <asp:Parameter Name="original_SprintBacklogID" />
                                    </DeleteParameters>
                                    <UpdateParameters>
                                        <asp:Parameter Name="Task" />
                                        <asp:Parameter Name="TaskOwnerID" />
                                        <asp:Parameter Name="ActualTimeTotal" />
                                        <asp:Parameter Name="RemainingTimeTotal" />
                                        <asp:Parameter Name="PuntedTimeTotal" />
                                        <asp:Parameter Name="Unbuffered" />
                                        <asp:Parameter Name="Discovered" />
                                        <asp:Parameter Name="Notes" />
                                        <asp:Parameter Name="original_SprintBacklogID" />
                                    </UpdateParameters>
                                </asp:SqlDataSource>
                                <br />
                            </ItemTemplate>
                        </asp:DataList>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostbackTrigger ControlID="chbHideCompleteTasks" EventName="CheckedChanged" />
                        <asp:AsyncPostbackTrigger ControlID="ddSprintSelection" EventName="SelectedIndexChanged" />
                        <asp:AsyncPostbackTrigger ControlID="ddFilterProdFeature" EventName="SelectedIndexChanged" />
                        <asp:AsyncPostbackTrigger ControlID="ddUserFilter" EventName="SelectedIndexChanged" />
                        <asp:AsyncPostbackTrigger ControlID="chbSortDSOrder" EventName="CheckedChanged" />
                    </Triggers>
                </asp:UpdatePanel>
                <asp:SqlDataSource ID="dsSprintBacklogProdFeature" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
                    ProviderName="<%$ ConnectionStrings:TackleConnectionStringMain.ProviderName %>"
                    SelectCommand="SELECT DISTINCT tblProducts.ProductName, tblMasterBacklog.Feature, tblMasterBacklog.MasterBacklogID, tblProducts.ProductName + ' : ' + tblMasterBacklog.Feature + ' : ' + Activity AS ProdFeature, tblMasterBacklog.Hours * @TimeMult as BaseTime, tblMasterBacklog.MasterRank FROM tblMasterBacklog INNER JOIN tblSprintBacklog ON tblMasterBacklog.MasterBacklogID = tblSprintBacklog.fMasterBacklogID INNER JOIN tblProducts ON tblMasterBacklog.fProductID = tblProducts.ProductID WHERE (tblSprintBacklog.fSprintID = @SprintID)"
                    OnSelecting="dsSprintBacklogProdFeature_Selecting">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="ddSprintSelection" Name="SprintID" PropertyName="SelectedValue" />
                        <asp:SessionParameter Name="TimeMult" SessionField="SBTimeMult" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="dsFilterProdFeature" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
                    ProviderName="<%$ ConnectionStrings:TackleConnectionStringMain.ProviderName %>"
                    SelectCommand="SELECT DISTINCT tblMasterBacklog.MasterBacklogID, tblProducts.ProductName + ' : ' + tblMasterBacklog.Feature + ' : ' + Activity AS ProdFeature, tblMasterBacklog.MasterRank AS MasterRank FROM tblMasterBacklog INNER JOIN tblSprintBacklog ON tblMasterBacklog.MasterBacklogID = tblSprintBacklog.fMasterBacklogID INNER JOIN tblProducts ON tblMasterBacklog.fProductID = tblProducts.ProductID WHERE (tblSprintBacklog.fSprintID = @SprintID) UNION SELECT - 3 AS MasterBacklogID, ' All' AS ProdFeature, - 3 AS MasterRank UNION SELECT - 2 AS MasterBacklogID, ' OOF' AS ProdFeature, - 2 AS MasterRank UNION SELECT - 1 AS MasterBacklogID, ' Discovered' AS ProdFeature, - 1 AS MasterRank ORDER BY ProdFeature">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="ddSprintSelection" Name="SprintID" PropertyName="SelectedValue" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="dsTaskOwners" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
                    ProviderName="<%$ ConnectionStrings:TackleConnectionStringMain.ProviderName %>"
                    SelectCommand="SELECT DISTINCT dbo.tblSprintResources.Person AS Owner, CONVERT(nvarchar, dbo.tblSprintResources.SprintResourcesID) AS PersonID&#13;&#10;FROM         dbo.tblSprintBacklog INNER JOIN&#13;&#10;                      dbo.tblSprintResources ON dbo.tblSprintBacklog.TaskOwnerID = dbo.tblSprintResources.SprintResourcesID&#13;&#10;WHERE     (dbo.tblSprintBacklog.fSprintID = @SprintID)&#13;&#10;UNION&#13;&#10;SELECT     TOP (100) PERCENT ' All' AS Owner, '%' AS PersonID&#13;&#10;ORDER BY Owner">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="ddSprintSelection" Name="SprintID" PropertyName="SelectedValue" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td colspan="4">
                <asp:UpdatePanel runat="server" ID="UPGridViewOOF" UpdateMode="Always">
                    <ContentTemplate>
                        <asp:Panel ID="panelOOFHours" runat="server" Width="100%">
                            <table style="border-right: silver 1px ridge; border-top: silver 1px ridge; border-left: silver 1px ridge;
                                border-bottom: silver 1px ridge" width="100%" cellpadding="0" cellspacing="0">
                                <tr style="font-size: 10pt">
                                    <td bgcolor="silver" style="text-align: left">
                                        &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CommandName="OOF" Font-Names="Verdana"
                                            Font-Size="X-Small" ForeColor="Black" OnClick="lkbBacklogItem_Click" ToolTip="Click to Filter to this Backlog Item"
                                            Font-Bold="True" CommandArgument="-2">OOF</asp:LinkButton><br />
                                        <span style="font-size: 1pt">
                                            <br />
                                        </span>
                                        <asp:GridView ID="gvOOFTasks" runat="server" AutoGenerateColumns="False" CellPadding="4"
                                            DataKeyNames="SprintBacklogID" DataSourceID="dsOOFTasks" Font-Names="Verdana"
                                            Font-Size="X-Small" ForeColor="#333333" GridLines="None" Width="100%" OnRowUpdating="GridViews_RowUpdating"
                                            AllowSorting="True" OnPreRender="GridView_PreRender" OnDataBound="GridView_DataBound"
                                            OnRowEditing="GridView_RowEditing" OnRowCancelingEdit="GridView_CancelEdit" OnRowUpdated="GridView_RowUpdated"
                                            OnRowDataBound="GridView_RowDataBound">
                                            <FooterStyle BackColor="Silver" Font-Bold="True" ForeColor="White" />
                                            <Columns>
                                                <asp:BoundField DataField="SprintBacklogID" HeaderText="ID" InsertVisible="False"
                                                    ReadOnly="True" SortExpression="SprintBacklogID" />
                                                <asp:TemplateField HeaderText="Task" SortExpression="Task">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBoxTask" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                                            Height="36px" MaxLength="255" Text='<%# Bind("Task") %>' TextMode="MultiLine"
                                                            ToolTip="'OOF' or a description of the OOF" Width="95%"></asp:TextBox><asp:RequiredFieldValidator
                                                                ID="rfvTask" runat="server" ControlToValidate="TextBoxTask" ErrorMessage="*?"
                                                                ForeColor="LightCoral" Font-Names="Verdana" Font-Size="Small" ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator><asp:CustomValidator
                                                                    ID="cvalidTask" runat="server" ControlToValidate="TextBoxTask" ErrorMessage="* Only 255 chars allowed."
                                                                    ForeColor="LightCoral" OnServerValidate="CustValMLMaxLength_ServerValidate" ToolTip="255"></asp:CustomValidator>
                                                    </EditItemTemplate>
                                                    <ItemStyle Width="35%" />
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("Task") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <FooterTemplate>
                                                        <asp:Image ID="imgOOFTimeUpdate" runat="server" ImageAlign="AbsBottom" ImageUrl="~/Images/Flag_redHS.png" /><asp:Label
                                                            ID="lblOOFAddTimeInfo" runat="server" Font-Bold="True" Font-Names="Verdana" Font-Size="X-Small"
                                                            ForeColor="#C00000" Text="Please update the time estimates and notes."></asp:Label>
                                                    </FooterTemplate>
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="TaskOwnerID" HeaderText="TaskOwnerID" SortExpression="TaskOwnerID"
                                                    Visible="False" />
                                                <asp:TemplateField HeaderText="Owner" SortExpression="Person">
                                                    <EditItemTemplate>
                                                        <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="dsResourceName"
                                                            DataTextField="Person" DataValueField="SprintResourcesID" Font-Names="Verdana"
                                                            Font-Size="X-Small" SelectedValue='<%# Bind("TaskOwnerID") %>'>
                                                        </asp:DropDownList>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("Person") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle Width="5%" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Base" SortExpression="BaseTime">
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("BaseTime", "{0:F}") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle Width="5%" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Actual" SortExpression="ActualTimeTotal">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBox1" runat="server" Font-Size="X-Small" Text='<%# Bind("ActualTimeTotal", "{0:F}") %>'
                                                            ToolTip="Enter the amount of time completed on the task total." Width="32px"
                                                            Font-Names="Verdana" OnPreRender="SetupOnFocus_PreRender"></asp:TextBox><asp:RequiredFieldValidator
                                                                ID="rfv1" runat="server" ControlToValidate="TextBox1" ErrorMessage="*?" ForeColor="LightCoral"
                                                                Font-Names="Verdana" Font-Size="Small" ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator><asp:RangeValidator
                                                                    ID="rv1" runat="server" ControlToValidate="TextBox1" ErrorMessage="*#" ForeColor="LightCoral"
                                                                    Font-Names="Verdana" Font-Size="Small" MaximumValue="10000" MinimumValue="0"
                                                                    ToolTip="This field must contain a number between 0 and 10000" Type="Double"></asp:RangeValidator>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="actualTime" runat="server" Text='<%# Bind("ActualTimeTotal", "{0:F}") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle Width="5%" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Remaining" SortExpression="RemainingTimeTotal">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="txtRemainingTime" runat="server" Font-Size="X-Small" Text='<%# Bind("RemainingTimeTotal", "{0:F}") %>'
                                                            ToolTip="Enter the amount of time remaining on the task." Width="32px" Font-Names="Verdana"
                                                            OnPreRender="SetupOnFocus_PreRender"></asp:TextBox><asp:RequiredFieldValidator ID="rfv2"
                                                                runat="server" ControlToValidate="txtRemainingTime" ErrorMessage="*?" ForeColor="LightCoral"
                                                                Font-Names="Verdana" Font-Size="Small" ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator><asp:RangeValidator
                                                                    ID="rv2" runat="server" ControlToValidate="txtRemainingTime" ErrorMessage="*#"
                                                                    ForeColor="LightCoral" Font-Names="Verdana" Font-Size="Small" MaximumValue="10000"
                                                                    MinimumValue="0" ToolTip="This field must contain a number between 0 and 10000"
                                                                    Type="Double"></asp:RangeValidator>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="remainingTime" runat="server" Text='<%# Bind("RemainingTimeTotal", "{0:F}") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle Width="5%" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Punted" SortExpression="PuntedTimeTotal">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBox3" runat="server" Font-Size="X-Small" Text='<%# Bind("PuntedTimeTotal", "{0:F}") %>'
                                                            ToolTip="Enter the amount of time punted on the task." Width="32px" Font-Names="Verdana"
                                                            OnPreRender="SetupOnFocus_PreRender"></asp:TextBox><asp:RequiredFieldValidator ID="rfv3"
                                                                runat="server" ControlToValidate="TextBox3" ErrorMessage="*?" ForeColor="LightCoral"
                                                                Font-Names="Verdana" Font-Size="Small" ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator><asp:RangeValidator
                                                                    ID="rv3" runat="server" ControlToValidate="TextBox3" ErrorMessage="*#" ForeColor="LightCoral"
                                                                    Font-Names="Verdana" Font-Size="Small" MaximumValue="10000" MinimumValue="0"
                                                                    ToolTip="This field must contain a number between 0 and 10000" Type="Double"></asp:RangeValidator>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label7" runat="server" Text='<%# Bind("PuntedTimeTotal", "{0:F}") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle Width="5%" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="OOF" SortExpression="OOF">
                                                    <ItemStyle Width="5%" />
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="CheckBox111" runat="server" Checked='<%# Bind("OOF") %>' Enabled="false"
                                                            ToolTip="An OOF task is a time spent out of the office unrelated to any feature tasks. Sick leave, vacation, holidays should be marked OOF." />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Disc" SortExpression="Discovered">
                                                    <EditItemTemplate>
                                                        <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("Discovered") %>' ToolTip="A discovered task is one that was not planned or accounted for during sprint planning." />
                                                    </EditItemTemplate>
                                                    <ItemStyle Width="5%" />
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("Discovered") %>' Enabled="false"
                                                            ToolTip="A discovered task is one that was not planned or accounted for during sprint planning." />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Notes" SortExpression="Notes">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBox5" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                                            Height="36px" MaxLength="255" Text='<%# Bind("Notes") %>' TextMode="MultiLine"
                                                            ToolTip="Any notes associated with the OOF" Width="95%"></asp:TextBox><br />
                                                        <asp:CustomValidator ID="cvalidNotes" runat="server" ControlToValidate="TextBox5"
                                                            ErrorMessage="* Only 255 chars allowed." ForeColor="LightCoral" OnServerValidate="CustValMLMaxLength_ServerValidate"
                                                            ToolTip="255"></asp:CustomValidator>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("Notes") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle Width="15%" />
                                                </asp:TemplateField>
                                                <asp:CommandField ShowEditButton="True" HeaderText="Edit">
                                                    <ItemStyle Width="5%" />
                                                </asp:CommandField>
                                                <asp:TemplateField HeaderText="Mark As">
                                                    <HeaderStyle Wrap="False" />
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="lbMBTaskComplete" runat="server" CommandArgument='<%# Eval("RemainingTimeTotal", "{0:F}") %>'
                                                            CommandName='<%# Eval("SprintBacklogID") %>' ForeColor="Black" OnClick="lbTaskComplete_Click"
                                                            OnClientClick="return confirm('Are you sure want to mark this task complete?');"
                                                            ToolTip="Mark this task as complete. Sets remaining time to 0">Complete</asp:LinkButton>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Add Time">
                                                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                                                    <HeaderStyle Wrap="False" HorizontalAlign="Center" />
                                                    <ItemTemplate>
                                                        <asp:DropDownList ID="ddQuickUpdateOOF" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                                            OnSelectedIndexChanged="ddQuickUpdate_SelectedIndexChanged" AutoPostBack="True">
                                                            <asp:ListItem Selected="True">0.00</asp:ListItem>
                                                            <asp:ListItem>0.25</asp:ListItem>
                                                            <asp:ListItem>0.50</asp:ListItem>
                                                            <asp:ListItem>1.00</asp:ListItem>
                                                            <asp:ListItem>1.50</asp:ListItem>
                                                            <asp:ListItem>2.00</asp:ListItem>
                                                            <asp:ListItem>2.50</asp:ListItem>
                                                            <asp:ListItem>3.00</asp:ListItem>
                                                            <asp:ListItem>3.50</asp:ListItem>
                                                            <asp:ListItem>4.00</asp:ListItem>
                                                            <asp:ListItem>4.50</asp:ListItem>
                                                            <asp:ListItem>5.00</asp:ListItem>
                                                            <asp:ListItem>5.50</asp:ListItem>
                                                            <asp:ListItem>6.00</asp:ListItem>
                                                            <asp:ListItem>6.50</asp:ListItem>
                                                            <asp:ListItem>7.00</asp:ListItem>
                                                            <asp:ListItem>7.50</asp:ListItem>
                                                            <asp:ListItem>8.00</asp:ListItem>
                                                        </asp:DropDownList><asp:Label ID="lblSBID" runat="server" Text='<%# Eval("SprintBacklogID") %>'
                                                            Visible="False"></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                            <RowStyle BackColor="#E3EAEB" VerticalAlign="Top" />
                                            <EditRowStyle BackColor="#7C6F57" VerticalAlign="Top" ForeColor="White" />
                                            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                                            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                                            <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                                            <AlternatingRowStyle BackColor="White" />
                                        </asp:GridView>
                                    </td>
                                </tr>
                                <tr style="font-size: 10pt">
                                    <td bgcolor="silver" style="width: 243px">
                                        &nbsp;<asp:LinkButton ID="lbNewOOFTask" runat="server" Font-Bold="True" Font-Names="Verdana"
                                            Font-Size="X-Small" ForeColor="#1C5E55" OnClick="lbNewOOFTask_Click">New Task</asp:LinkButton></td>
                                </tr>
                            </table>
                            <asp:SqlDataSource ID="dsOOFTasks" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
                                OldValuesParameterFormatString="original_{0}" ProviderName="<%$ ConnectionStrings:TackleConnectionStringMain.ProviderName %>"
                                SelectCommand="SELECT tblSprintBacklog.Task, tblSprintResources.Person, tblSprintBacklog.BaseTime * @TimeMult AS BaseTime, tblSprintBacklog.ActualTimeTotal * @TimeMult AS ActualTimeTotal, tblSprintBacklog.RemainingTimeTotal * @TimeMult AS RemainingTimeTotal, tblSprintBacklog.PuntedTimeTotal * @TimeMult AS PuntedTimeTotal, tblSprintBacklog.Notes, tblSprintBacklog.OOF, tblSprintBacklog.Discovered, tblSprintBacklog.SprintBacklogID, tblSprintBacklog.TaskOwnerID FROM tblSprintBacklog INNER JOIN tblSprintResources ON tblSprintBacklog.TaskOwnerID = tblSprintResources.SprintResourcesID WHERE (tblSprintBacklog.fSprintID = @SprintID) AND (tblSprintBacklog.OOF = 1) AND (tblSprintBacklog.fMasterBacklogID IS NULL) AND ((tblSprintBacklog.RemainingTimeTotal > @RemainingTimeTotalFilter - 1) OR (tblSprintBacklog.SprintBacklogID = @ShowSBID))"
                                DeleteCommand="DELETE FROM tblSprintBacklog WHERE (SprintBacklogID = @original_SprintBacklogID)"
                                OnDeleting="dsSprintBacklog_Deleting" UpdateCommand="UPDATE tblSprintBacklog SET Task = @Task, TaskOwnerID = @TaskOwnerID, ActualTimeTotal = @ActualTimeTotal, RemainingTimeTotal = @RemainingTimeTotal, PuntedTimeTotal = @PuntedTimeTotal, Discovered = @Discovered, Notes = @Notes WHERE (SprintBacklogID = @original_SprintBacklogID)">
                                <DeleteParameters>
                                    <asp:Parameter Name="original_SprintBacklogID" />
                                </DeleteParameters>
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="ddSprintSelection" Name="SprintID" PropertyName="SelectedValue" />
                                    <asp:ControlParameter ControlID="chbHideCompleteTasks" Name="RemainingTimeTotalFilter"
                                        PropertyName="Checked" />
                                    <asp:SessionParameter Name="TimeMult" SessionField="SBTimeMult" />
                                    <asp:SessionParameter DefaultValue="0" Name="ShowSBID" SessionField="DailyScrumEntry_ShowSBID" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                        </asp:Panel>
                        &nbsp;
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostbackTrigger ControlID="chbHideCompleteTasks" EventName="CheckedChanged" />
                        <asp:AsyncPostbackTrigger ControlID="ddSprintSelection" EventName="SelectedIndexChanged" />
                        <asp:AsyncPostbackTrigger ControlID="ddFilterProdFeature" EventName="SelectedIndexChanged" />
                        <asp:AsyncPostbackTrigger ControlID="ddUserFilter" EventName="SelectedIndexChanged" />
                    </Triggers>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr style="font-size: 10pt">
            <td colspan="4">
                <asp:UpdatePanel runat="server" ID="UPGridViewDisc" UpdateMode="Always">
                    <ContentTemplate>
                        <asp:Panel ID="panelDiscovered" runat="server" Width="100%">
                            <table style="border-right: silver 1px ridge; border-top: silver 1px ridge; border-left: silver 1px ridge;
                                border-bottom: silver 1px ridge" width="100%" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td bgcolor="silver" style="width: 100%">
                                        &nbsp;<asp:LinkButton ID="LinkButton1" runat="server" CommandName="Discovered" Font-Names="Verdana"
                                            Font-Size="X-Small" ForeColor="Black" OnClick="lkbBacklogItem_Click" ToolTip="Click to Filter to this Backlog Item"
                                            Font-Bold="True" CommandArgument="-1">Discovered</asp:LinkButton><br />
                                        <span style="font-size: 1pt">
                                            <br />
                                        </span>
                                        <asp:GridView ID="gvDiscoveredTasks" runat="server" AutoGenerateColumns="False" CellPadding="4"
                                            DataKeyNames="SprintBacklogID" DataSourceID="dsDiscoveredTasks" Font-Names="Verdana"
                                            Font-Size="X-Small" ForeColor="#333333" GridLines="None" Width="100%" OnRowUpdating="GridViews_RowUpdating"
                                            AllowSorting="True" OnPreRender="GridView_PreRender" OnDataBound="GridView_DataBound"
                                            OnRowEditing="GridView_RowEditing" OnRowCancelingEdit="GridView_CancelEdit" OnRowUpdated="GridView_RowUpdated"
                                            OnRowDataBound="GridView_RowDataBound">
                                            <FooterStyle BackColor="Silver" Font-Bold="True" ForeColor="White" />
                                            <Columns>
                                                <asp:BoundField DataField="SprintBacklogID" HeaderText="ID" InsertVisible="False"
                                                    ReadOnly="True" SortExpression="SprintBacklogID" />
                                                <asp:TemplateField HeaderText="Task" SortExpression="Task">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBoxTask" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                                            Height="36px" MaxLength="255" Text='<%# Bind("Task") %>' TextMode="MultiLine"
                                                            ToolTip="A description of the discovered work. This should not be a task related to any other products in the sprint backlog"
                                                            Width="95%"></asp:TextBox>
                                                        <asp:RequiredFieldValidator ID="rfvTask" runat="server" ControlToValidate="TextBoxTask"
                                                            ErrorMessage="*?" ForeColor="LightCoral" Font-Names="Verdana" Font-Size="Small"
                                                            ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator><asp:CustomValidator
                                                                ID="cvalidTask" runat="server" ControlToValidate="TextBoxTask" ErrorMessage="* Only 255 chars allowed."
                                                                ForeColor="LightCoral" OnServerValidate="CustValMLMaxLength_ServerValidate" ToolTip="255"></asp:CustomValidator>
                                                    </EditItemTemplate>
                                                    <ItemStyle Width="35%" />
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("Task") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <FooterTemplate>
                                                        <asp:Image ID="imgOOFTimeUpdate" runat="server" ImageAlign="AbsBottom" ImageUrl="~/Images/Flag_redHS.png" /><asp:Label
                                                            ID="lblOOFAddTimeInfo" runat="server" Font-Bold="True" Font-Names="Verdana" Font-Size="X-Small"
                                                            ForeColor="#C00000" Text="Please update the time estimates and notes."></asp:Label>
                                                    </FooterTemplate>
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="TaskOwnerID" HeaderText="TaskOwnerID" SortExpression="TaskOwnerID"
                                                    Visible="False" />
                                                <asp:TemplateField HeaderText="Owner" SortExpression="Person">
                                                    <EditItemTemplate>
                                                        <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="dsResourceName"
                                                            DataTextField="Person" DataValueField="SprintResourcesID" Font-Names="Verdana"
                                                            Font-Size="X-Small" SelectedValue='<%# Bind("TaskOwnerID") %>'>
                                                        </asp:DropDownList>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("Person") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle Width="5%" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Base" SortExpression="BaseTime">
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("BaseTime", "{0:F}") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle Width="5%" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Actual" SortExpression="ActualTimeTotal">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBox1" runat="server" Font-Size="X-Small" Text='<%# Bind("ActualTimeTotal", "{0:F}") %>'
                                                            ToolTip="Enter the amount of time completed on the task total." Width="32px"
                                                            Font-Names="Verdana" OnPreRender="SetupOnFocus_PreRender"></asp:TextBox><asp:RequiredFieldValidator
                                                                ID="rfv1" runat="server" ControlToValidate="TextBox1" ErrorMessage="*?" ForeColor="LightCoral"
                                                                Font-Names="Verdana" Font-Size="Small" ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator><asp:RangeValidator
                                                                    ID="rv1" runat="server" ControlToValidate="TextBox1" ErrorMessage="*#" ForeColor="LightCoral"
                                                                    Font-Names="Verdana" Font-Size="Small" MaximumValue="10000" MinimumValue="0"
                                                                    ToolTip="This field must contain a number between 0 and 10000" Type="Double"></asp:RangeValidator>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="actualTime" runat="server" Text='<%# Bind("ActualTimeTotal", "{0:F}") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle Width="5%" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Remaining" SortExpression="RemainingTimeTotal">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBox2" runat="server" Font-Size="X-Small" Text='<%# Bind("RemainingTimeTotal", "{0:F}") %>'
                                                            ToolTip="Enter the amount of time remaining on the task." Width="32px" Font-Names="Verdana"
                                                            OnPreRender="SetupOnFocus_PreRender"></asp:TextBox><asp:RequiredFieldValidator ID="rfv2"
                                                                runat="server" ControlToValidate="TextBox2" ErrorMessage="*?" ForeColor="LightCoral"
                                                                Font-Names="Verdana" Font-Size="Small" ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator><asp:RangeValidator
                                                                    ID="rv2" runat="server" ControlToValidate="TextBox2" ErrorMessage="*#" ForeColor="LightCoral"
                                                                    Font-Names="Verdana" Font-Size="Small" MaximumValue="10000" MinimumValue="0"
                                                                    ToolTip="This field must contain a number between 0 and 10000" Type="Double"></asp:RangeValidator>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="remainingTime" runat="server" Text='<%# Bind("RemainingTimeTotal", "{0:F}") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle Width="5%" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Punted" SortExpression="PuntedTimeTotal">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBox3" runat="server" Font-Size="X-Small" Text='<%# Bind("PuntedTimeTotal", "{0:F}") %>'
                                                            ToolTip="Enter the amount of time punted on the task." Width="32px" Font-Names="Verdana"
                                                            OnPreRender="SetupOnFocus_PreRender"></asp:TextBox><asp:RequiredFieldValidator ID="rfv3"
                                                                runat="server" ControlToValidate="TextBox3" ErrorMessage="*?" ForeColor="LightCoral"
                                                                Font-Names="Verdana" Font-Size="Small" ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator><asp:RangeValidator
                                                                    ID="rv3" runat="server" ControlToValidate="TextBox3" ErrorMessage="*#" ForeColor="LightCoral"
                                                                    Font-Names="Verdana" Font-Size="Small" MaximumValue="10000" MinimumValue="0"
                                                                    ToolTip="This field must contain a number between 0 and 10000" Type="Double"></asp:RangeValidator>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label7" runat="server" Text='<%# Bind("PuntedTimeTotal", "{0:F}") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle Width="5%" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Unbuff" SortExpression="Unbuffered">
                                                    <EditItemTemplate>
                                                        <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("Unbuffered") %>' ToolTip="An unbuffered task is one in which the hours are time boxed." />
                                                    </EditItemTemplate>
                                                    <ItemStyle Width="5%" />
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("Unbuffered") %>' Enabled="false"
                                                            ToolTip="An unbuffered task is one in which the hours are time boxed." />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Disc" SortExpression="Discovered">
                                                    <ItemStyle Width="5%" />
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("Discovered") %>' Enabled="false"
                                                            ToolTip="A discovered task is one that was not planned or accounted for during sprint planning." />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Notes" SortExpression="Notes">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBox5" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                                            Height="36px" MaxLength="255" Text='<%# Bind("Notes") %>' TextMode="MultiLine"
                                                            ToolTip="Any notes associated with the OOF" Width="95%"></asp:TextBox><br />
                                                        <asp:CustomValidator ID="cvalidNotes" runat="server" ControlToValidate="TextBox5"
                                                            ErrorMessage="* Only 255 chars allowed." ForeColor="LightCoral" OnServerValidate="CustValMLMaxLength_ServerValidate"
                                                            ToolTip="255"></asp:CustomValidator>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("Notes") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle Width="15%" />
                                                </asp:TemplateField>
                                                <asp:CommandField ShowEditButton="True" HeaderText="Edit">
                                                    <ItemStyle Width="5%" />
                                                </asp:CommandField>
                                                <asp:TemplateField HeaderText="Mark As">
                                                    <HeaderStyle Wrap="False" />
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="lbMBTaskComplete" runat="server" CommandArgument='<%# Eval("RemainingTimeTotal", "{0:F}") %>'
                                                            CommandName='<%# Eval("SprintBacklogID") %>' ForeColor="Black" OnClick="lbTaskComplete_Click"
                                                            OnClientClick="return confirm('Are you sure want to mark this task complete?');"
                                                            ToolTip="Mark this task as complete. Sets remaining time to 0">Complete</asp:LinkButton>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Add Time">
                                                    <ItemTemplate>
                                                        <asp:DropDownList ID="ddQuickUpdateDisc" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                                            OnSelectedIndexChanged="ddQuickUpdate_SelectedIndexChanged" AutoPostBack="True">
                                                            <asp:ListItem Selected="True">0.00</asp:ListItem>
                                                            <asp:ListItem>0.25</asp:ListItem>
                                                            <asp:ListItem>0.50</asp:ListItem>
                                                            <asp:ListItem>1.00</asp:ListItem>
                                                            <asp:ListItem>1.50</asp:ListItem>
                                                            <asp:ListItem>2.00</asp:ListItem>
                                                            <asp:ListItem>2.50</asp:ListItem>
                                                            <asp:ListItem>3.00</asp:ListItem>
                                                            <asp:ListItem>3.50</asp:ListItem>
                                                            <asp:ListItem>4.00</asp:ListItem>
                                                            <asp:ListItem>4.50</asp:ListItem>
                                                            <asp:ListItem>5.00</asp:ListItem>
                                                            <asp:ListItem>5.50</asp:ListItem>
                                                            <asp:ListItem>6.00</asp:ListItem>
                                                            <asp:ListItem>6.50</asp:ListItem>
                                                            <asp:ListItem>7.00</asp:ListItem>
                                                            <asp:ListItem>7.50</asp:ListItem>
                                                            <asp:ListItem>8.00</asp:ListItem>
                                                        </asp:DropDownList><asp:Label ID="lblSBID" runat="server" Text='<%# Eval("SprintBacklogID") %>'
                                                            Visible="False"></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle HorizontalAlign="Center" Wrap="True" Width="10%" />
                                                    <HeaderStyle Wrap="False" HorizontalAlign="Center" />
                                                </asp:TemplateField>
                                            </Columns>
                                            <RowStyle BackColor="#E3EAEB" VerticalAlign="Top" />
                                            <EditRowStyle BackColor="#7C6F57" VerticalAlign="Top" ForeColor="White" />
                                            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                                            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                                            <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                                            <AlternatingRowStyle BackColor="White" />
                                        </asp:GridView>
                                    </td>
                                </tr>
                                <tr>
                                    <td bgcolor="silver" style="width: 100%">
                                        &nbsp;<asp:LinkButton ID="lbDiscNewTask" runat="server" Font-Bold="True" Font-Names="Verdana"
                                            Font-Size="X-Small" ForeColor="#1C5E55" OnClick="lbDiscNewTask_Click">New Task</asp:LinkButton></td>
                                </tr>
                            </table>
                            <asp:SqlDataSource ID="dsDiscoveredTasks" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
                                OldValuesParameterFormatString="original_{0}" ProviderName="<%$ ConnectionStrings:TackleConnectionStringMain.ProviderName %>"
                                SelectCommand="SELECT tblSprintBacklog.Task, tblSprintResources.Person, tblSprintBacklog.BaseTime * @TimeMult AS BaseTime, tblSprintBacklog.ActualTimeTotal * @TimeMult AS ActualTimeTotal, tblSprintBacklog.RemainingTimeTotal * @TimeMult AS RemainingTimeTotal, tblSprintBacklog.PuntedTimeTotal * @TimeMult AS PuntedTimeTotal, tblSprintBacklog.Notes, IsNull(tblSprintBacklog.Unbuffered,0) as Unbuffered, tblSprintBacklog.Discovered, tblSprintBacklog.SprintBacklogID, tblSprintBacklog.TaskOwnerID FROM tblSprintBacklog INNER JOIN tblSprintResources ON tblSprintBacklog.TaskOwnerID = tblSprintResources.SprintResourcesID WHERE (tblSprintBacklog.fSprintID = @SprintID) AND (tblSprintBacklog.fMasterBacklogID IS NULL) AND (tblSprintBacklog.Discovered = 1) AND (tblSprintBacklog.OOF = 0) AND ((tblSprintBacklog.RemainingTimeTotal > @RemainingTimeTotalFilter - 1) OR (tblSprintBacklog.SprintBacklogID = @ShowSBID))"
                                DeleteCommand="DELETE FROM tblSprintBacklog WHERE (SprintBacklogID = @original_SprintBacklogID)"
                                OnDeleting="dsSprintBacklog_Deleting" UpdateCommand="UPDATE tblSprintBacklog SET Task = @Task, TaskOwnerID = @TaskOwnerID, ActualTimeTotal = @ActualTimeTotal, RemainingTimeTotal = @RemainingTimeTotal, PuntedTimeTotal = @PuntedTimeTotal, Unbuffered = @Unbuffered, Notes = @Notes WHERE (SprintBacklogID = @original_SprintBacklogID)">
                                <DeleteParameters>
                                    <asp:Parameter Name="original_SprintBacklogID" />
                                </DeleteParameters>
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="ddSprintSelection" Name="SprintID" PropertyName="SelectedValue" />
                                    <asp:ControlParameter ControlID="chbHideCompleteTasks" Name="RemainingTimeTotalFilter"
                                        PropertyName="Checked" />
                                    <asp:SessionParameter Name="TimeMult" SessionField="SBTimeMult" />
                                    <asp:SessionParameter DefaultValue="0" Name="ShowSBID" SessionField="DailyScrumEntry_ShowSBID" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                            <asp:SqlDataSource ID="dsResourceName" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
                                ProviderName="<%$ ConnectionStrings:TackleConnectionStringMain.ProviderName %>"
                                SelectCommand="SELECT Person, SprintResourcesID FROM tblSprintResources WHERE (fSprintID = @SprintID) ORDER BY Person">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="ddSprintSelection" Name="SprintID" PropertyName="SelectedValue" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                        </asp:Panel>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostbackTrigger ControlID="chbHideCompleteTasks" EventName="CheckedChanged" />
                        <asp:AsyncPostbackTrigger ControlID="ddSprintSelection" EventName="SelectedIndexChanged" />
                        <asp:AsyncPostbackTrigger ControlID="ddFilterProdFeature" EventName="SelectedIndexChanged" />
                        <asp:AsyncPostbackTrigger ControlID="ddUserFilter" EventName="SelectedIndexChanged" />
                    </Triggers>
                </asp:UpdatePanel>
            </td>
        </tr>
    </table>
    <asp:SqlDataSource ID="dsGetSprintNames" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
        SelectCommand="SELECT DISTINCT tblMasterBacklogSchedule.SprintName, tblMasterBacklogSchedule.EndDate, tblSprint.SprintID FROM tblSprint LEFT OUTER JOIN tblSprintBacklog ON tblSprint.SprintID = tblSprintBacklog.fSprintID RIGHT OUTER JOIN tblMasterBacklogSchedule ON tblSprint.fMasterBacklogScheduleID = tblMasterBacklogSchedule.MasterBacklogScheduleID WHERE (tblMasterBacklogSchedule.fScrumTeamID = @ScrumTeamID) AND (tblSprintBacklog.fSprintID IS NOT NULL) ORDER BY tblMasterBacklogSchedule.EndDate DESC">
        <SelectParameters>
            <asp:SessionParameter Name="ScrumTeamID" SessionField="ScrumTeamID" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>
